package com.poisonh.unifiedauth.dialog;

import android.annotation.SuppressLint;
import android.app.DialogFragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.TextView;

import com.poisonh.unifiedauth.R;

/**
 * 用户身份证信息展示Dialog
 * Created by PoisonH on 2016/6/24.
 */
public class UserInfoDialogFragment extends DialogFragment
{
    private TextView mTvReallName;
    private TextView mTvCard;
    private String mStrReallName;
    private String mStrCard;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
    {
        getDialog().requestWindowFeature(Window.FEATURE_NO_TITLE);
        @SuppressLint("InflateParams")
        View view = inflater.inflate(R.layout.layout_dialog_userinfo, null);
        mStrReallName = getArguments().getString("REALNAME");
        mStrCard = getArguments().getString("CARD");
        return view;
    }

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState)
    {
        super.onViewCreated(view, savedInstanceState);
        mTvReallName = (TextView) view.findViewById(R.id.tv_userinfodialog_reallyname);
        mTvCard = (TextView) view.findViewById(R.id.tv_userinfodialog_card);
        if (mStrReallName.equals("null") || mStrCard.equals("null"))
        {
            mTvReallName.setText("姓名：未完善个人信息");
            mTvCard.setText("身份证：未完善个人信息");
        } else
        {
            mTvReallName.setText("姓名：" + mStrReallName);
            mTvCard.setText("身份证：" + mStrCard);
        }
    }

}
